package com.xdf.data_transmitter.controller;

import com.sun.media.jfxmedia.logging.Logger;
import com.xdf.data_transmitter.model.Alarm;
import com.xdf.data_transmitter.service.AlarmService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/alarm")
@Slf4j
public class AlarmController {

    @Autowired
    private AlarmService service;

    @GetMapping("/selectAll")
    public List<Alarm> selectAll(){
        log.info("你查询了云端的报警记录！");
        return service.selectAll();
    }
}
